package com.daji.stream;


import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class UserPojo implements Comparable<UserPojo>{
    private int id;
    private String name;
    private String address;
    private int age;


    @Override
    public int compareTo(UserPojo o) {
        //return 为0代表两个元素相等，如果为正或负，代表不等。（到底是谁大谁小，调试一下就知道了）
        return o.getAge() - this.getAge();
    }
}
